package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.AgreementMapper;
import com.education.wisdom.pojo.Agreement;
import com.education.wisdom.service.IAgreementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 协议 服务层实现
 * 
 * @author ruoyi
 * @date 2019-02-28
 */
@Service
public class AgreementServiceImpl implements IAgreementService
{
	@Autowired
	private AgreementMapper agreementMapper;

	/**
     * 查询协议信息
     * 
     * @param id 协议ID
     * @return 协议信息
     */
    @Override
	public Agreement selectAgreementById(Integer id)
	{
	    return agreementMapper.selectAgreementById(id);
	}
	@Override
	public Agreement selectAgreementBytype(String type)
	{
	    return agreementMapper.selectAgreementBytype(type);
	}
	
	/**
     * 查询协议列表
     * 
     * @param agreement 协议信息
     * @return 协议集合
     */
	@Override
	public List<Agreement> selectAgreementList(Agreement agreement)
	{
	    return agreementMapper.selectAgreementList(agreement);
	}
	
    /**
     * 新增协议
     * 
     * @param agreement 协议信息
     * @return 结果
     */
	@Override
	public int insertAgreement(Agreement agreement)
	{
	    return agreementMapper.insertAgreement(agreement);
	}
	
	/**
     * 修改协议
     * 
     * @param agreement 协议信息
     * @return 结果
     */
	@Override
	public int updateAgreement(Agreement agreement)
	{
	    return agreementMapper.updateAgreement(agreement);
	}

	/**
     * 删除协议对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteAgreementByIds(String ids)
	{
		return agreementMapper.deleteAgreementByIds(Convert.toStrArray(ids));
	}
	
}
